package gstudio;

import gstudio.data.DataIO;
import gstudio.images.MyImage;

import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ICoolBarManager;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.swt.SWT;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.application.ActionBarAdvisor;
import org.eclipse.ui.application.IActionBarConfigurer;

public class ApplicationActionBarAdvisor extends ActionBarAdvisor {

	public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) {
		super(configurer);
	}

	protected void fillCoolBar(ICoolBarManager coolBar) {
		IToolBarManager toolBar = new ToolBarManager(SWT.FLAT | SWT.SHADOW_OUT);
		coolBar.add(toolBar);
		Action saveAction = new Action() {
			public void run() {
				DataIO.getInstance().saveXML();
			}
		};
		saveAction.setText("saveText");
		saveAction.setImageDescriptor(new MyImage().get("save_edit.gif"));
		toolBar.add(saveAction);

	}

	protected void fillMenuBar(IMenuManager menuBar) {
		System.out.println("load ApplicationActionBarAdvisor");
	}

	protected void makeActions(final IWorkbenchWindow window) {

	}
}
